
#ifndef  GSMEG_LINK_INFO_H
#define  GSMEG_LINK_INFO_H

#include "z_base_api.h"
#include "link.h"
#include "gsmeg.h"
#include "api_lrm.h"

#define GSMEG_LINK_CREATED 0  //unused
#define GSMEG_LINK_CONNECTED 1
#define GSMEG_LINK_LOGINED 2
#define GSMEG_LINK_DISCONNECTED 3 //unused


typedef struct gsmeg_link_s{
    long long channel_;
    int state_;
}gsmeg_link_t;

gsmeg_link_t *gsmeg_link_create(long long channel,int state);
void gsmeg_link_destroy(gsmeg_link_t *gsmeg_link);

int gsmeg_link_update_state(gsmeg_link_t *gsmeg_link_info,int state);
int gsmeg_link_send_msg(gsmeg_link_t *gsmeg_link,char *gsmeg, int con_len,int cmd);
int gsmeg_link_is_valid(gsmeg_link_t *gsmeg_link);

#endif   /* GSMEG_LINK_INFO_H */

